<?php

namespace app\service\tag;

use app\models\cacheModel\SettingModel;
use yii\base\Model;

/**
 * 设置 模板标签
 * Class Setting
 * @package app\models
 */
class GetSetting extends Model
{

    /**
     * 键
     * @var
     */
    public $key;

    public function beforeRun()
    {

        echo $this->run();
    }

    public function afterRun()
    {

    }

    /**
     * 运行总方法
     */
    public function run()
    {

        try {
            return SettingModel::getSetting($this->key, true);
        } catch (\Exception $error) {
            return null;
        }
    }
}
